﻿using UnityEngine;
using System.Collections;

public class GateManager : MonoBehaviour {

	public GameObject[] gates;
	public int currentGateIndex = 0;
	public GameObject church;
	private GameObject currentTarget;

	// Use this for initialization
	void Start () {
		currentTarget = gates[0];
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public GameObject GetCurrentTarget(){
		return currentTarget;
	}

	public void NextGate(){
		currentGateIndex++;
		if(currentGateIndex >= gates.Length){
			currentTarget = church;
		}
		else {
			currentTarget = gates[currentGateIndex];
		}
	}
}
